import path from "path";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { viteMockServe } from "vite-plugin-mock"
// https://vitejs.dev/config/
export default defineConfig({
  root: "./",
  base: "./",
  plugins: [
    vue(),
    viteMockServe({
      supportTs: false     //如果使用 js发开，则需要配置 supportTs 为 false
    })
  ],
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: "@use '@/styles/element/index.scss' as *;",
      },
    },
  },
});
